Optimal. Leaf size=36 \[ \frac {\tanh ^{-1}\left (\frac {\sqrt {a \csc ^2(x)}}{\sqrt {a}}\right )}{\sqrt {a}}-\frac {1}{\sqrt {a \csc ^2(x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3738, 4209, 53,
65, 213} \begin {gather*} \frac {\tanh ^{-1}\left (\frac {\sqrt {a \csc ^2(x)}}{\sqrt {a}}\right )}{\sqrt {a}}-\frac {1}{\sqrt {a \csc ^2(x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 53
Rule 65
Rule 213
Rule 3738
Rule 4209
Rubi steps
\begin {align*} \int \frac {\tan (x)}{\sqrt {a+a \cot ^2(x)}} \, dx &=\int \frac {\tan (x)}{\sqrt {a \csc ^2(x)}} \, dx\\ &=-\left (\frac {1}{2} a \text {Subst}\left (\int \frac {1}{(-1+x) (a x)^{3/2}} \, dx,x,\csc ^2(x)\right )\right )\\ &=-\frac {1}{\sqrt {a \csc ^2(x)}}-\frac {1}{2} \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {a x}} \, dx,x,\csc ^2(x)\right )\\ &=-\frac {1}{\sqrt {a \csc ^2(x)}}-\frac {\text {Subst}\left (\int \frac {1}{-1+\frac {x^2}{a}} \, dx,x,\sqrt {a \csc ^2(x)}\right )}{a}\\ &=\frac {\tanh ^{-1}\left (\frac {\sqrt {a \csc ^2(x)}}{\sqrt {a}}\right )}{\sqrt {a}}-\frac {1}{\sqrt {a \csc ^2(x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 49, normalized size = 1.36 \begin {gather*} -\frac {\csc (x) \left (\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-\log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )+\sin (x)\right )}{\sqrt {a \csc ^2(x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.57, size = 56, normalized size = 1.56
method | result | size |
default | \(-\frac {\left (\sin \left (x \right )-\ln \left (-\frac {\cos \left (x \right )-1-\sin \left (x \right )}{\sin \left (x \right )}\right )+\ln \left (-\frac {\cos \left (x \right )-1+\sin \left (x \right )}{\sin \left (x \right )}\right )\right ) \sqrt {4}}{2 \sin \left (x \right ) \sqrt {-\frac {a}{\cos ^{2}\left (x \right )-1}}}\) | \(56\) |
risch | \(-\frac {{\mathrm e}^{2 i x}}{2 \sqrt {-\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}\, \left ({\mathrm e}^{2 i x}-1\right )}+\frac {1}{2 \left ({\mathrm e}^{2 i x}-1\right ) \sqrt {-\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}}-\frac {i {\mathrm e}^{i x} \ln \left ({\mathrm e}^{i x}-i\right )}{\sqrt {-\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}\, \left ({\mathrm e}^{2 i x}-1\right )}+\frac {i {\mathrm e}^{i x} \ln \left ({\mathrm e}^{i x}+i\right )}{\sqrt {-\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}\, \left ({\mathrm e}^{2 i x}-1\right )}\) | \(157\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 52, normalized size = 1.44 \begin {gather*} -\frac {1}{2} \, a {\left (\frac {\log \left (-\frac {\sqrt {a} - \sqrt {\frac {a}{\sin \left (x\right )^{2}}}}{\sqrt {a} + \sqrt {\frac {a}{\sin \left (x\right )^{2}}}}\right )}{a^{\frac {3}{2}}} + \frac {2}{a \sqrt {\frac {a}{\sin \left (x\right )^{2}}}}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 78 vs.
\(2 (28) = 56\).
time = 2.95, size = 78, normalized size = 2.17 \begin {gather*} \frac {{\left (\tan \left (x\right )^{2} + 1\right )} \sqrt {a} \log \left (2 \, a \tan \left (x\right )^{2} + 2 \, \sqrt {a} \sqrt {\frac {a \tan \left (x\right )^{2} + a}{\tan \left (x\right )^{2}}} \tan \left (x\right )^{2} + a\right ) - 2 \, \sqrt {\frac {a \tan \left (x\right )^{2} + a}{\tan \left (x\right )^{2}}} \tan \left (x\right )^{2}}{2 \, {\left (a \tan \left (x\right )^{2} + a\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tan {\left (x \right )}}{\sqrt {a \left (\cot ^{2}{\left (x \right )} + 1\right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.46, size = 12, normalized size = 0.33 \begin {gather*} -\frac {\sin \left (x\right )}{\sqrt {a} \mathrm {sgn}\left (\sin \left (x\right )\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.42, size = 20, normalized size = 0.56 \begin {gather*} \frac {\mathrm {atanh}\left (\sqrt {\frac {1}{{\sin \left (x\right )}^2}}\right )-\sqrt {{\sin \left (x\right )}^2}}{\sqrt {a}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________